import axios from "axios";
import { getUrlParam } from "./tools";
const baserUrl = "https://www.slb.careoe.com/applet";
// const baserUrl = 'http://192.168.1.251/applet'
// const baserUrl = 'http://39.100.225.189:9999/applet'
// const baserUrl = "https://430ke79608.zicp.vip/applet";
export function fetchPost(url, params = {}, idempotenceToken = "") {
  let jwt = localStorage.getItem("jwt");
  return axios({
    method: "POST",
    url: baserUrl + url,
    data: params,
    headers: {
      "Content-Type": "application/json; charset=UTF-8",
      jwt: getUrlParam("jwt") ? getUrlParam("jwt") : jwt,
      idempotenceToken: idempotenceToken,
    },
  });
}
export function fetchGet(url, params = {}) {
  return axios.get(url, { params: params });
}
